package com.heo.sso.server.dto;

import lombok.Data;

/**
 * @Author 刘康
 * @Date 2020-11-02 11:27
 * @Description
 * @Revision
 **/
@Data
public class Result<T> {

    private int code;

    private String msg;

    private T date;


    public static Result error(int code, String msg) {
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }

    public static Result success(Object data) {
        Result result = new Result();
        result.setCode(0);
        result.setMsg("success");
        result.setDate(data);
        return result;
    }

    ;

}
